# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.TPU.V2.Model.Node do
  @moduledoc """
  A TPU instance.

  ## Attributes

  *   `acceleratorConfig` (*type:* `GoogleApi.TPU.V2.Model.AcceleratorConfig.t`, *default:* `nil`) - The AccleratorConfig for the TPU Node.
  *   `acceleratorType` (*type:* `String.t`, *default:* `nil`) - Optional. The type of hardware accelerators associated with this node.
  *   `apiVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The API version that created this Node.
  *   `cidrBlock` (*type:* `String.t`, *default:* `nil`) - The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the node was created.
  *   `dataDisks` (*type:* `list(GoogleApi.TPU.V2.Model.AttachedDisk.t)`, *default:* `nil`) - The additional data disks for the Node.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The user-supplied description of the TPU. Maximum of 512 characters.
  *   `health` (*type:* `String.t`, *default:* `nil`) - The health status of the TPU node.
  *   `healthDescription` (*type:* `String.t`, *default:* `nil`) - Output only. If this field is populated, it contains a description of why the TPU Node is unhealthy.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The unique identifier for the TPU Node.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Resource labels to represent user-provided metadata.
  *   `metadata` (*type:* `map()`, *default:* `nil`) - Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script
  *   `multisliceNode` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the Node belongs to a Multislice group.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Immutable. The name of the TPU.
  *   `networkConfig` (*type:* `GoogleApi.TPU.V2.Model.NetworkConfig.t`, *default:* `nil`) - Network configurations for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned.
  *   `networkConfigs` (*type:* `list(GoogleApi.TPU.V2.Model.NetworkConfig.t)`, *default:* `nil`) - Optional. Repeated network configurations for the TPU node. This field is used to specify multiple networks configs for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned.
  *   `networkEndpoints` (*type:* `list(GoogleApi.TPU.V2.Model.NetworkEndpoint.t)`, *default:* `nil`) - Output only. The network endpoints where TPU workers can be accessed and sent work. It is recommended that runtime clients of the node reach out to the 0th entry in this map first.
  *   `queuedResource` (*type:* `String.t`, *default:* `nil`) - Output only. The qualified name of the QueuedResource that requested this Node.
  *   `runtimeVersion` (*type:* `String.t`, *default:* `nil`) - Required. The runtime version running in the Node.
  *   `schedulingConfig` (*type:* `GoogleApi.TPU.V2.Model.SchedulingConfig.t`, *default:* `nil`) - The scheduling options for this node.
  *   `serviceAccount` (*type:* `GoogleApi.TPU.V2.Model.ServiceAccount.t`, *default:* `nil`) - The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is specified, the default compute service account will be used.
  *   `shieldedInstanceConfig` (*type:* `GoogleApi.TPU.V2.Model.ShieldedInstanceConfig.t`, *default:* `nil`) - Shielded Instance options.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state for the TPU Node.
  *   `symptoms` (*type:* `list(GoogleApi.TPU.V2.Model.Symptom.t)`, *default:* `nil`) - Output only. The Symptoms that have occurred to the TPU Node.
  *   `tags` (*type:* `list(String.t)`, *default:* `nil`) - Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :acceleratorConfig => GoogleApi.TPU.V2.Model.AcceleratorConfig.t() | nil,
          :acceleratorType => String.t() | nil,
          :apiVersion => String.t() | nil,
          :cidrBlock => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :dataDisks => list(GoogleApi.TPU.V2.Model.AttachedDisk.t()) | nil,
          :description => String.t() | nil,
          :health => String.t() | nil,
          :healthDescription => String.t() | nil,
          :id => String.t() | nil,
          :labels => map() | nil,
          :metadata => map() | nil,
          :multisliceNode => boolean() | nil,
          :name => String.t() | nil,
          :networkConfig => GoogleApi.TPU.V2.Model.NetworkConfig.t() | nil,
          :networkConfigs => list(GoogleApi.TPU.V2.Model.NetworkConfig.t()) | nil,
          :networkEndpoints => list(GoogleApi.TPU.V2.Model.NetworkEndpoint.t()) | nil,
          :queuedResource => String.t() | nil,
          :runtimeVersion => String.t() | nil,
          :schedulingConfig => GoogleApi.TPU.V2.Model.SchedulingConfig.t() | nil,
          :serviceAccount => GoogleApi.TPU.V2.Model.ServiceAccount.t() | nil,
          :shieldedInstanceConfig => GoogleApi.TPU.V2.Model.ShieldedInstanceConfig.t() | nil,
          :state => String.t() | nil,
          :symptoms => list(GoogleApi.TPU.V2.Model.Symptom.t()) | nil,
          :tags => list(String.t()) | nil
        }

  field(:acceleratorConfig, as: GoogleApi.TPU.V2.Model.AcceleratorConfig)
  field(:acceleratorType)
  field(:apiVersion)
  field(:cidrBlock)
  field(:createTime, as: DateTime)
  field(:dataDisks, as: GoogleApi.TPU.V2.Model.AttachedDisk, type: :list)
  field(:description)
  field(:health)
  field(:healthDescription)
  field(:id)
  field(:labels, type: :map)
  field(:metadata, type: :map)
  field(:multisliceNode)
  field(:name)
  field(:networkConfig, as: GoogleApi.TPU.V2.Model.NetworkConfig)
  field(:networkConfigs, as: GoogleApi.TPU.V2.Model.NetworkConfig, type: :list)
  field(:networkEndpoints, as: GoogleApi.TPU.V2.Model.NetworkEndpoint, type: :list)
  field(:queuedResource)
  field(:runtimeVersion)
  field(:schedulingConfig, as: GoogleApi.TPU.V2.Model.SchedulingConfig)
  field(:serviceAccount, as: GoogleApi.TPU.V2.Model.ServiceAccount)
  field(:shieldedInstanceConfig, as: GoogleApi.TPU.V2.Model.ShieldedInstanceConfig)
  field(:state)
  field(:symptoms, as: GoogleApi.TPU.V2.Model.Symptom, type: :list)
  field(:tags, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.TPU.V2.Model.Node do
  def decode(value, options) do
    GoogleApi.TPU.V2.Model.Node.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TPU.V2.Model.Node do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
